import {axioslink} from "@/api/api"

export let My = {
    state: {
        Quanzi: {},
        Quanzidata: []
    },
    mutations: {
        //处理数据的地方
        HomeInit(state, payload) {
            state[payload.key] = payload.value;
            // console.log(state[payload.key])
        }
    },
    actions: {
        //使用Actions 进行异步操作（异步请求)
        Myxaxios(context, payload) {
            console.log(payload)
            axioslink("/My/list", "get").then((ok) => {
                context.commit("HomeInit", {key: "Quanzi", value: ok.data.Quanzi})
                context.commit("HomeInit", {key: "Quanzidata", value: ok.data.Quanzidata})
            })
        }
    }
}